home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / frame.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  78 lines

  1. #include "frame.h"
  2.  
  3. Frame::Frame(rect coordinates, BORDERS b_type, int s, int t)
  4.     {
  5.     tog = t;
  6.     rectangle = coordinates;
  7.     shadow = s;
  8.     border_type = b_type;
  9.     }
  10. ///////////////////
  11. void Frame::show()
  12.     {
  13.     rect ltrb;
  14.     ltrb = tog ? rectangle : screenRect(rectangle);
  15.     Carcase::show(border_type, ltrb, shadow);
  16.     Shadow::show(ltrb, shadow);
  17.     }
  18. ////////////////////
  19. void Frame::hilite()
  20.     {
  21.     rect ltrb;
  22.     ltrb = tog ? rectangle : screenRect(rectangle);
  23.     Carcase::show(HILITE_BORDER, ltrb, shadow);
  24.     }
  25. //////////////////////
  26. void Frame::unhilite()
  27.     {
  28.     rect ltrb;
  29.     ltrb = tog ? rectangle : screenRect(rectangle);
  30.     Carcase::show(border_type, ltrb, shadow);
  31.     }
  32. //////////////////////
  33. void Frame::press()
  34.     {
  35.     rect ltrb;
  36.     ltrb = tog ? rectangle : screenRect(rectangle);
  37.     Carcase::show(PRESS_BORDER, ltrb, shadow);
  38.     }
  39. //////////////////////
  40. void Frame::release()
  41.     {
  42.     Frame::show();
  43.     Frame::hilite();
  44.     }
  45. //////////////////////
  46. /*
  47. void demo()
  48.     {
  49.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  50.     bar(0, 0, getmaxx(), getmaxy());
  51.  
  52.     Frame f(rect(10, 10, 100, 50), BUTTON_BORDER, 6, SCREEN);
  53.     f.show();
  54.     Frame f1(rect(10, 110, 100, 150), STANDART_BORDER, 6, SCREEN);
  55.     f1.show();
  56.     Frame f2(rect(10, 160, 100, 200), SHOW_BORDER, 6, SCREEN);
  57.     f2.show();
  58.     Frame f3(rect(1, 20, 60, 25), PRESS_BORDER, 6, TEXT);
  59.     f3.show();
  60.     f.hilite();
  61.     f.press();
  62.     f.release();
  63.     f.unhilite();
  64.     }
  65.  
  66. void main()
  67.     {
  68.     if(!init_KNOW_HOW())
  69.         return;
  70.     demo();
  71.     pColorSet->loadColorSet(1);
  72.     demo();
  73.     pColorSet->loadColorSet(2);
  74.     demo();
  75.     close_KNOW_HOW();
  76.     closegraph();
  77.     }
  78. */